# +--------------------------
# | User: zq                -
# | Version: python3.7      -
# | Time: 2020-03-12 13:31                
# +--------------------------
from threading import Thread

total = 0


def add():
    global total
    for i in range(1000000):
        total += 1


def desc():
    global total
    for i in range(1000000):
        total -= 1


if __name__ == '__main__':
    add_thread = Thread(target=add)
    desc_thread = Thread(target=desc)

    add_thread.start()
    desc_thread.start()

    add_thread.join()
    desc_thread.join()

    print(total)
